<%--
  Created by IntelliJ IDEA.
  User: Xiaoqz
  Date: 2021/9/1
  Time: 18:14
  To change this template use File | Settings | File Templates.
--%>
<%--isELIgnored: 忽视EL表达式--%>
<%--@ page contentType="text/html;charset=UTF-8" language="java" --%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%--引入JSTL标签库--%>
<html>
<style>
    html {
        height: 100%;
        width: 100%;
        overflow: hidden;
        margin: 0;
        padding: 0;
        background: url(imgs/img31.png) no-repeat 0px 0px;
        background-size: 100% 100%;
        -moz-background-size: 100% 100%;
        /*opacity:.20;*/
    }
</style>
<head>
    <title>student</title>
</head>
<body>
<h2 align="center">学生数据信息管理</h2>
<hr>
<table align="center" border="1" width="50%" cellspacing="0">
    <tr>
        <th>序号</th>
        <th>姓名</th>
        <th>生日</th>
        <th>数学</th>
        <th>英语</th>
        <th>班级</th>
        <th>住址</th>
        <th>操作</th>
    </tr>
    <form action="/stuCURD/sellectAllServlet" method="post">
        <c:forEach items="${stus}" var="stu" varStatus="status">
            <tr align="center">
                <td>${status.count}</td>
                <td>${stu.sname}</td>
                <td>${stu.birthday}</td>
                <td>${stu.math}</td>
                <td>${stu.english}</td>
                <td>${stu.className}</td>
                <td>${stu.address}</td>
                <td>
                    <a href="/stuCURD/selectByIdServlet?id=${stu.id}"><input type="button" value="修改"></a>
                    <input type="button" value="删除" onclick="new function() {
                      let flag = false;
                      if (confirm('确认删除？')){
                          location.href = '/stuCURD/deleteServlet?id=${stu.id}';
                          flag = true;
                      }
                      return flag;
                    }">
                </td>
            </tr>
        </c:forEach>
    </form>
    <tr>
        <td align="center" colspan="8">
            <input type="button" value="添加" onclick="add()">
        </td>
    </tr>
</table>
<script>
    function add(){
        location.href = "add.jsp";
    }
</script>
</body>
</html>
